#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <stdlib.h>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(ui->pushButton_left,&QPushButton::clicked,this,&Widget::mySlotLeft);
    connect(ui->pushButton_right,&QPushButton::clicked,this,&Widget::mySlotRight);
}
void Widget::mySlotRight()
{
   //先获取窗口大小
    int width = this->geometry().width();
    int height = this->geometry().height();
    int x = rand() % width;
    int y = rand() % height;
    ui->pushButton_right->move(x,y);
    ui->pushButton_right->setText("QAQ");
}
void Widget::mySlotLeft()
{
    qDebug()<<"宝宝来亲亲~mua~";
    ui->pushButton_left->resize(80,50);
}
Widget::~Widget()
{
    delete ui;
}

